package com.imoblife.brainwavestus.users;

import android.content.Context;
import android.content.SharedPreferences;

public class UserAccount {
	private String gmail;
	private String name;
	private String imei;
	private String gold;
	private String status; //���û��������û������û���1�����û���0.
	private boolean isLogin;
	public Context mContext;
	public static String USER_SETTINGS = "user_settings";
	
	public UserAccount(Context context){
		this.mContext = context;
	}
	
	public void setIsLogin(boolean isLogin){
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putBoolean("isLogin", isLogin).commit();
	}
	
	
	public boolean getIsLogin(){
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		isLogin = settings.getBoolean("isLogin", false);
		return isLogin;
	}

	public String getGmail() {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		gmail = settings.getString("gmail", null);
		return gmail;
	}

	public void setGmail(String gmail) {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putString("gmail", gmail).commit();
	}

	public String getName() {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		name = settings.getString("name", null);
		return name;
	}

	public void setName(String name) {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putString("name", name).commit();
	}

	public String getImei() {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		imei = settings.getString("imei", null);
		return imei;
	}

	public void setImei(String imei) {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putString("imei", imei).commit();
	}

	public String getGold() {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		gold = settings.getString("gold", "0");
		return gold;
	}

	public void setGold(String gold) {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putString("gold", gold).commit();
	}
	
	public String getStatus() {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		status = settings.getString("status", "0");
		return status;
	}

	public void setStatus(String status) {
		SharedPreferences settings = mContext.getSharedPreferences(USER_SETTINGS,0);
		settings.edit().putString("status", status).commit();
	}
	

}
